public class test4 {
    public static void main(String[] args) {
         int[] arr = {4,1,2,1,2};
         int n = target(arr);
        System.out.println(n);
    }
     public static int target(int[] arr) {
        int sum = 0;
        for(int i=0;i<arr.length;i++) {
             sum ^= arr[i];
         }
        return sum;
    }
}